package com.example.wechat;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;

import android.view.ViewGroup;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class UserInfoFragment extends Fragment implements View.OnClickListener{


    private ListView mListView;
    private MyAdapterSub myAdapterSub;
    private List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();



    protected void onCreateview(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState ) {
        View view =inflater.inflate(R.layout.activity_userinfo,container,false);


        initData();
        mListView=view.findViewById(R.id.listviewSet);

        myAdapterSub=new MyAdapterSub(list,this);
        mListView.setAdapter(myAdapterSub);
        Log.d("UserInfo", "onCreate: User Info activity created");


    }


    private  void initData(){
        Map<String,Object> map =new HashMap<String, Object>();
        map.put("img",R.drawable.ic_launcher_background);
        map.put("title","设置");
        list.add(map);
        map =new HashMap<String, Object>();
        map.put("img",R.drawable.ic_launcher_background);
        map.put("title","设置1");
        list.add(map);
        map =new HashMap<String, Object>();
        map.put("img",R.drawable.ic_launcher_background);
        map.put("title","设置2");
        list.add(map);

    }

    @Override
    public void onClick(View v) {

    }
}
